package com.epam.javalab.giorgadze.task2.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * User: Luka
 * Date: 03.03.14
 * Time: 21:15
 */
public class ConfiguratorManager {
    private static final Logger log = LoggerFactory.getLogger(ConfiguratorManager.class);
    Properties properties = new Properties();

    public ConfiguratorManager(String filename) {
        InputStream inputStream = ConfiguratorManager.class.getClassLoader().getResourceAsStream(filename);
        try {
            properties.load(inputStream);
        } catch (IOException e) {
            log.error("Could not read regex from file!");
        }
    }

    public String getProperty(String key) {
        return  properties.getProperty(key);
    }
}
